/**
 * @param {number[]} nums
 * @param {number} original
 * @return {number}
 */
 var findFinalValue = function(nums, original) {
  const s = new Set(nums)
  while(s.has(original)){
    original *= 2
  }
  return original
};